#!/bin/bash
DIRNAME=$(dirname `readlink -f $0`)/..

CP=`echo $DIRNAME/lib/*.jar $DIRNAME/*.jar | sed -e 's/ /:/g'`

COMMAND="javadoc -docletpath $CP -private -doclet org.tldgen.TldDoclet"

if [[ $1 = "-help" || $1 = "--help" ]]
then
	shift
fi


if [ $# -eq 0 ]
then
	COMMAND="$COMMAND -sourcepath . -subpackages org"
	eval $COMMAND
	exit
fi

while [ $# -ge 1 ]; do
	if echo $1 | grep -Eq ^\-.*
	then
		COMMAND="$COMMAND $1"
	else
		COMMAND="$COMMAND \"$1\""
	fi
	shift
done

echo $COMMAND
eval $COMMAND
